home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 1 / CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso / Aminet / comm / tcp / ATCP_sdk_40_gc.lha / AmiTCP-4.0-gcc / netinclude / rpcsvc / rstat.x < prev    next >
Text File  |  1995-04-07  |  2KB  |  118 lines

  1. /* @(#)rstat.x    2.2 88/08/01 4.0 RPCSRC */
  2. /* @(#)rstat.x 1.2 87/09/18 Copyr 1987 Sun Micro */
  3.  
  4.  
  5. /*
  6.  * Gather statistics on remote machines
  7.  */
  8.  
  9. #ifdef RPC_HDR
  10.  
  11. %#ifndef FSCALE
  12. %/*
  13. % * Scale factor for scaled integers used to count load averages.
  14. % */
  15. %#define FSHIFT  8               /* bits to right of fixed binary point */
  16. %#define FSCALE  (1<<FSHIFT)
  17. %
  18. %#endif /* ndef FSCALE */
  19.  
  20. #endif /* def RPC_HDR */
  21.  
  22. const CPUSTATES = 4;
  23. const DK_NDRIVE = 4;
  24.  
  25. /*
  26.  * GMT since 0:00, January 1, 1970
  27.  */
  28. struct rstat_timeval {
  29.     unsigned int tv_sec;    /* seconds */
  30.     unsigned int tv_usec;    /* and microseconds */
  31. };
  32.  
  33. struct statstime {                /* RSTATVERS_TIME */
  34.     int cp_time[CPUSTATES];
  35.     int dk_xfer[DK_NDRIVE];
  36.     unsigned int v_pgpgin;    /* these are cumulative sum */
  37.     unsigned int v_pgpgout;
  38.     unsigned int v_pswpin;
  39.     unsigned int v_pswpout;
  40.     unsigned int v_intr;
  41.     int if_ipackets;
  42.     int if_ierrors;
  43.     int if_oerrors;
  44.     int if_collisions;
  45.     unsigned int v_swtch;
  46.     int avenrun[3];         /* scaled by FSCALE */
  47.     rstat_timeval boottime;
  48.     rstat_timeval curtime;
  49.     int if_opackets;
  50. };
  51.  
  52. struct statsswtch {            /* RSTATVERS_SWTCH */
  53.     int cp_time[CPUSTATES];
  54.     int dk_xfer[DK_NDRIVE];
  55.     unsigned int v_pgpgin;    /* these are cumulative sum */
  56.     unsigned int v_pgpgout;
  57.     unsigned int v_pswpin;
  58.     unsigned int v_pswpout;
  59.     unsigned int v_intr;
  60.     int if_ipackets;
  61.     int if_ierrors;
  62.     int if_oerrors;
  63.     int if_collisions;
  64.     unsigned int v_swtch;
  65.     unsigned int avenrun[3];/* scaled by FSCALE */
  66.     rstat_timeval boottime;
  67.     int if_opackets;
  68. };
  69.  
  70. struct stats {                /* RSTATVERS_ORIG */
  71.     int cp_time[CPUSTATES];
  72.     int dk_xfer[DK_NDRIVE];
  73.     unsigned int v_pgpgin;    /* these are cumulative sum */
  74.     unsigned int v_pgpgout;
  75.     unsigned int v_pswpin;
  76.     unsigned int v_pswpout;
  77.     unsigned int v_intr;
  78.     int if_ipackets;
  79.     int if_ierrors;
  80.     int if_oerrors;
  81.     int if_collisions;
  82.     int if_opackets;
  83. };
  84.  
  85.  
  86. program RSTATPROG {
  87.     /*
  88.      * Newest version includes current time and context switching info
  89.      */
  90.     version RSTATVERS_TIME {
  91.         statstime
  92.         RSTATPROC_STATS(void) = 1;
  93.  
  94.         unsigned int
  95.         RSTATPROC_HAVEDISK(void) = 2;
  96.     } = 3;
  97.     /*
  98.      * Does not have current time
  99.      */
  100.     version RSTATVERS_SWTCH {
  101.         statsswtch
  102.         RSTATPROC_STATS(void) = 1;
  103.  
  104.         unsigned int
  105.         RSTATPROC_HAVEDISK(void) = 2;
  106.     } = 2;
  107.     /*
  108.      * Old version has no info about current time or context switching
  109.      */
  110.     version RSTATVERS_ORIG {
  111.         stats
  112.         RSTATPROC_STATS(void) = 1;
  113.  
  114.         unsigned int
  115.         RSTATPROC_HAVEDISK(void) = 2;
  116.     } = 1;
  117. } = 100001;
  118.